package com.chamberlain.equipment.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.chamberlain.common.annotation.Excel;
import com.chamberlain.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * @author: CYY
 * @date: 2024/3/25
 */
public class Electric extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 电能设备id */
    @Excel(name = "电能设备id")
    private Integer id;

    /** 设备名称 */
    @Excel(name = "设备名称")
    private String name;

    /** 设备图片 */
    @Excel(name = "设备图片")
    private String imageUrl;

    /** 数据 */
    @Excel(name = "数据")
    private Long value;

    /** 数据单位 */
    @Excel(name = "数据单位")
    private String unit;

    /** mac地址 */
    @Excel(name = "mac地址")
    private String mac;

    /** 设备状态 0 开 1 关 */
    @Excel(name = "设备状态 0 开 1 关")
    private Integer state;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdTime;

    public void setId(Integer id)
    {
        this.id = id;
    }

    public Integer getId()
    {
        return id;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }
    public void setImageUrl(String imageUrl)
    {
        this.imageUrl = imageUrl;
    }

    public String getImageUrl()
    {
        return imageUrl;
    }
    public void setValue(Long value)
    {
        this.value = value;
    }

    public Long getValue()
    {
        return value;
    }
    public void setUnit(String unit)
    {
        this.unit = unit;
    }

    public String getUnit()
    {
        return unit;
    }
    public void setMac(String mac)
    {
        this.mac = mac;
    }

    public String getMac()
    {
        return mac;
    }
    public void setState(Integer state)
    {
        this.state = state;
    }

    public Integer getState()
    {
        return state;
    }
    public void setCreatedTime(Date createdTime)
    {
        this.createdTime = createdTime;
    }

    public Date getCreatedTime()
    {
        return createdTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("imageUrl", getImageUrl())
                .append("value", getValue())
                .append("unit", getUnit())
                .append("mac", getMac())
                .append("state", getState())
                .append("createdTime", getCreatedTime())
                .toString();
    }
}
